dy-lib=libmethods.so
static-lib=libmymath.a

.PHONY:all
all:${static-lib} ${dy-lib}
${static-lib}:math.o
	ar -rc $@ $^
math.o:math.c
	gcc -c $^
${dy-lib}:print.o log.o
	gcc -shared -o $@ $^
print.o:print.c
	gcc -fPIC -c $^
log.o:log.c
	gcc -fPIC -c $^

.PHONY:clean
clean:
	rm *.a *.o *.so mylib -rf

.PHONY:output
output:
	mkdir -p mylib/include
	mkdir -p mylib/lib
	cp *.h mylib/include
	cp *.a mylib/lib
	cp *.so mylib/lib
